package com.matt.foundation.vo;

import com.matt.foundation.utils.DateUtil;
import lombok.Data;

import java.util.Date;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2017/9/28
 * *******************************
 */
@Data
public class CourseChangeRecordVo {
    private String delta;
    private String remark;
    private String name;
    private String date;

    public static CourseChangeRecordVo of(Object[] objects) {
        CourseChangeRecordVo vo = new CourseChangeRecordVo();
        vo.setDelta(objects[0]== null ? null : objects[0].toString());
        vo.setRemark(objects[1] == null ? null : objects[1].toString());
        vo.setName(objects[3] == null ? "系统" : objects[3].toString());
        vo.setDate(objects[2] == null ? "" : DateUtil.millisToDateTime(((Date)objects[2]).getTime(), "yyyy-MM-dd"));
        return vo;
    }
}
